<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="icon" href="https://static.nowcoder.com/images/logo_87_87.png"/>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
          crossorigin="anonymous">
    <link rel="stylesheet" th:href="@{/css/global.css}"/>
    <title>湘西区</title>
</head>
<body>
<div class="nk-container">


    <input type="button" value="biaoge" id="btn"/>

    <div id="box">

    </div>

    <script>
        var arr=[
            {name:"baidu",href:"http://www.baidu.com"},
            {name:"baidu",href:"http://www.baidu.com"},
            {name:"baidu",href:"http://www.baidu.com"},
            {name:"baidu",href:"http://www.baidu.com"},

        ];


        document.getElementById("btn").onclick=function(){
            var str="<table border='1'>";
            for(var i=0;i<arr.length;i++){
                str+="<tr>"+"<td>"+arr[i].name+"</td>"+"<td>"+"<a href="+arr[i].href+">"+arr[i].name+"</a>"+"</td>"
            }
            str+="</table>";
            document.getElementById("box").innerHTML=str;
        }

    </script>



</div>

<script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
        crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" crossorigin="anonymous"></script>
<script th:src="@{/js/global.js}"></script>
<script th:src="@{js/index.js}"></script>



</body>
</html>
